package com.fuxi.cloud.common.util;

import cn.hutool.core.util.CharsetUtil;
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import cn.hutool.crypto.symmetric.SymmetricCrypto;

/**
 * SecurityUtil
 *
 * @Author: 扫地僧
 * @CreateTime: 2021-05-03
 */
public class SecurityUtil {
    private static String key = "JEECGBOOT1423670";

    public SecurityUtil() {
    }

    public static String jiami(String content) {
        SymmetricCrypto var1 = new SymmetricCrypto(SymmetricAlgorithm.AES, key.getBytes());
        String var2 = var1.encryptHex(content);
        return var2;
    }

    public static String jiemi(String encryptResultStr) {
        SymmetricCrypto var1 = new SymmetricCrypto(SymmetricAlgorithm.AES, key.getBytes());
        String var2 = var1.decryptStr(encryptResultStr, CharsetUtil.CHARSET_UTF_8);
        return var2;
    }

    public static void main(String[] args) {
        String var1 = "test1111";
        String var2 = jiami(var1);
        System.out.println(var2);
        String var3 = jiemi(var2);
        System.out.println(var3);
    }
}

